package cn.itheima.health.demo;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.Set;

public class JedisDemo {
    public static void main(String[] args) {
//        ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("applicationContext-redis.xml");
//        JedisPool jedisPool = (JedisPool)app.getBean("jedisPool");  //  dataSource
//       Jedis jedis = jedisPool.getResource();  // Connection
////        key:value
//          jedis.set("aa","bb");
//
//          //  set
//        jedis.sadd("myset","bb","cc","dd");
//        jedis.sadd("myset1","bb","cc");
//
//        Set<String> sdiff = jedis.sdiff("myset", "myset1");
////        Set<String> sdiff = jedis.sdiff("myset1", "myset");
//        System.out.println(sdiff);  //  dd
//
//
//        jedis.close();


    }
}
